package com.googlecode.ws.tester.xor.wsdl.model;

import java.util.List;
import java.util.ArrayList;

/**
 * Created by IntelliJ IDEA.
 * User: pablo
 * Date: 2009-06-09
 * Time: 20:01:17
 */
public class Message {
    private String name;
    private List<Part> parts;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public List<Part> getParts() {
        return parts;
    }

    public void setParts(List<Part> parts) {
        this.parts = parts;
    }

    public void addPart(Part part) {
        if(this.parts==null) {
            this.parts = new ArrayList<Part>();
        }
        this.parts.add(part);
    }

    @Override
    public String toString() {
        final StringBuilder sb = new StringBuilder();
        sb.append("Message");
        sb.append("{name='").append(name).append('\'');
        sb.append(", part=").append(parts);
        sb.append('}');
        return sb.toString();
    }
}
